<?xml version="1.0" encoding="ISO-8859-1"?>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:h="http://java.sun.com/jsf/html"
  xmlns:f="http://java.sun.com/jsf/core"
  xmlns:s="http://jboss.com/products/seam/taglib"
  template="/WEB-INF/templates/template.xhtml"
  xmlns:a4j="http://richfaces.org/a4j"
  xmlns:rich="http://richfaces.org/rich">
  
  <ui:define name="head">
  </ui:define>
<ui:define name="editConsumoArticulo">
   <center >
   <br />
	<h:outputText value="Maestro de articulos"  styleClass="tituloabm"/>
   <br />
	<br /> 	
   <div class ="divabm">
   
   <h:form  id = "saveconsumoarticuloform" rendered="#{appUser.userLogin != null}" >
    	<h:panelGrid columns="1">
    		<h:outputText value="#{messages.edithelparticulo}" styleClass="outputcommon"/>
    	</h:panelGrid>
    	<h:panelGrid columns= "2">
    		<h:outputText value="Formato bolsa: " styleClass="outputcommonbold" />
    		<h:outputText value="#{articuloCtrl.articuloSelected.descripcion}" styleClass="outputcommonbold"  />
    	</h:panelGrid>
    	
    	<table>
    	<ui:repeat value="#{articuloCtrl.consumos}" var="consumo" >
			<tr>
				<td><h:outputText value="#{consumo.tipo.descripcion}" styleClass="outputcommonbold"/></td>
				<td><h:inputText value="#{consumo.consumo}" /></td>
			</tr>
    	</ui:repeat>
    		<tr>
    			<td><h:outputText value="Armado" styleClass="outputcommonbold" rendered="#{articuloCtrl.esArtesanal()}"/></td>
    			<td>
    				<h:selectOneMenu value="#{articuloCtrl.armado}" converter="#{armadoadapter.converter}" rendered="#{articuloCtrl.esArtesanal()}">
    					<f:selectItems value="#{armadoadapter.items}"/>
    				</h:selectOneMenu>
    			</td>
    		</tr>
		</table>

    	<br />
		<br />
    	<h:panelGrid columns="2">
    			<h:commandLink action="admin-articulo.jsf" styleClass="commandLink">
    				<h:commandButton action="#{articuloCtrl.clearData()}" value ="Volver" styleClass="volverbutton" />
	   		   </h:commandLink>
	   		   
	   		   <h:commandButton action="#{articuloCtrl.saveConsumoArticulo()}" value ="Guardar" styleClass="guardarbutton"  />
    	</h:panelGrid>
    	<h:panelGrid columns="1">
    			<h:outputText id="savesuccessmsg" value="#{messages.savesuccess}" rendered = "#{articuloCtrl.saveSuccess}"  style="FONT-WEIGHT: bold; COLOR: #ff0000;"/>
    			<h:outputText id="deletesuccessmsg" value="#{messages.deletesuccess}" rendered = "#{articuloCtrl.deleteSuccess}"  style="FONT-WEIGHT: bold; COLOR: #ff0000;"/>
    	</h:panelGrid>
    	
    </h:form>
	
	</div>
	</center>
	</ui:define>
<ui:define name="body">
 </ui:define>    	
 </ui:composition>

